package top.codehelen.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.codehelen.mapper.UsersMapper;
import top.codehelen.pojo.Users;
import top.codehelen.service.UsersService;

/**
 * @Classname UsersServiceImpl
 * @Description UsersServiceImpl
 * @Date 2021/5/12 10:25 上午
 * @Created by helen
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {


    @Override
    public boolean selectUserNameIsExist(String userName) {

        QueryWrapper<Users> wrapper = new QueryWrapper();
        wrapper.eq("username",userName);
        Users user = getBaseMapper().selectOne(wrapper);
        return user != null;
    }
}
